<?php

class Notification_Widget_Browse_Profile_Notification extends Nuo_Widget
{
	function execute()
	{
		$table = Nuo::getTable('notification');

		$viewer = Nuo::getUser();

		$select = $table -> select() -> order('created_at DESC');

		$select -> where('receiver_id=?', $viewer -> getItemId());

		$paging = Nuo_Paging::factory($select);

		return $this -> render(array(
			'paging' => $paging,
			'count' => $paging -> getItemCount()
		));
	}

}
